import Vue from 'vue'
import Router from 'vue-router'

/* components */
import Main from '@/components/Main.vue'

import Home from '@/components/main/Home.vue'
import Building from '@/components/main/Building.vue'
import Floor from '@/components/main/Floor.vue'
import SetLig from '@/components/main/Set.vue'

import SetBg from '@/components/set/Set-bg.vue'
import setMod from '@/components/set/Set-module.vue'
import ModOne from '@/components/set/Mod-one.vue'
import ModAll from '@/components/set/Mod-all.vue'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'main',
      component: Main,
      redirect: "/main/home",
      children: [{
          path: '/main/home',
          name: 'home',
          component: Home,
          meta: {
            keepAlive: true 
          }
        },
        {
          path: '/main/building',
          name: 'building',
          component: Building,
          meta: {
            keepAlive: true 
          }
        },
        {
          path: '/main/floor',
          name: 'floor',
          component: Floor,
          meta: {
            keepAlive: true 
          }
        },
        {
          path: '/main/set',
          name: 'set',
          component: SetLig,
          meta: {
            keepAlive: true 
          }
        }
      ],
    },
    {
      path: '/set-bg',
      name: 'setbg',
      component: SetBg,
      meta: {
        keepAlive: true 
      }
    },
    {
      path: '/set-mod',
      name: 'setMod',
      component: setMod,
      meta: {
        keepAlive: false // 不需要被缓存
      }
    },
    {
      path: '/mod-one',
      name: 'modOne',
      component: ModOne,
      meta: {
        keepAlive: false // 不需要被缓存
      }
    },
    {
      path: '/mod-all',
      name: 'modAll',
      component: ModAll,
      meta: {
        keepAlive: false // 不需要被缓存
      }
    }

  ],
  /*   mode: "history", */

})
